package com.slmn.model;

import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.TokenFactory;
import org.antlr.v4.runtime.TokenSource;
import org.antlr.v4.runtime.misc.Pair;

public class SymbolASTFactory implements TokenFactory<SymbolAST> {

	@Override
	public SymbolAST create(Pair<TokenSource, CharStream> source, int type,
			String text, int channel, int start, int stop, int line,
			int charPositionInLine) {
		SymbolAST t =  new SymbolAST(source, type, channel, start, stop);
		t.setLine(line);
		t.setCharPositionInLine(charPositionInLine);
		t.setText(text);
		return t;
	}

	@Override
	public SymbolAST create(int type, String text) {
		return new SymbolAST(type, text);
	}
	
}
